<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src="/js/album_view.js"></script>

<head th:include="/base/common_css('test')">
<body>
<div th:include="/base/common_banner"></div>
<!-- Main content starts -->

<div class="content">
    <!-- Sidebar -->
    <div th:include="/base/common_menu"></div>
    <!-- Sidebar
    <div class="sidebar">
        <div class="sidebar-dropdown"><a href="#">Navigation</a></div>

    </div>-->
    <!-- Matter -->
    <div class="mainbar">
        <!-- Page heading -->
        <div th:include="/base/common_pageHeader"></div>

        <div class="matter">
            <div class="container">
                <div class="row">
                    <div class="col-md-12">


                        <div class="widget wgreen">

                            <div class="widget-head">
                                <div class="pull-left">添加专辑</div>
                                <div class="widget-icons pull-right">
                                    <a href="#" class="wminimize"><i class="icon-chevron-up"></i></a>
                                    <a href="#" class="wclose"><i class="icon-remove"></i></a>
                                </div>
                                <div class="clearfix"></div>
                            </div>

                            <div class="widget-content">
                                <div class="padd">

                                    <!-- Form starts.  -->
                                    <form class="form-horizontal" role="form" action="#" method="post">
                                        <div class="form-group">
                                            <input class="col-lg-4 form-control " type="hidden" id="albId"
                                                   th:value="${albId}">
                                        </div>
                                        <div class="form-group">
                                            <label class="col-lg-4 control-label">专辑名</label>
                                            <div class="col-lg-8">
                                                <input type="text" id="albName" th:value="${albName}"
                                                       class="form-control" placeholder="专辑名">
                                            </div>
                                        </div>

                                        <div class="form-group">
                                            <label class="col-lg-4 control-label">专辑描述</label>
                                            <div class="col-lg-8">
                                                <input type="text" id="albDescription" class="form-control"
                                                       placeholder="专辑描述" th:value="${albDescription}">
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-lg-4 control-label">原价</label>
                                            <div class="col-lg-8">
                                                <input type="text" id="originalPrice" class="form-control"
                                                       placeholder="原价" th:value="${originalPrice}">
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-lg-4 control-label">现价</label>
                                            <div class="col-lg-8">
                                                <input type="text" id="presentPrice" class="form-control"
                                                       placeholder="现价" th:value="${presentPrice}">
                                            </div>
                                        </div>

                                        <div class="form-group">
                                            <label class="col-lg-4 control-label">模特</label>
                                            <div class="col-lg-8">
                                                <select id="modelId" class="selectpicker show-tick form-control">
                                                    <option th:each="model, modelStat:${modelList}"
                                                            th:value="${model.modelId}"
                                                            th:text="${model.modelName}"
                                                            th:selected="${model.modelId == modelId}"></option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-lg-4 control-label">归属分类</label>
                                            <div class="col-lg-8">
                                                <select id="cateList" class="selectpicker show-tick form-control"
                                                        multiple>
                                                    <th:block th:each="cate, cateStat:${cateList}">
                                                        <option th:value="${cate.cateId}"
                                                                th:text="${cate.cateName}"
                                                                th:selected="${cate.isShow ==10}"></option>
                                                    </th:block>

                                                    </th:block>
                                                </select>

                                            </div>
                                        </div>

                                        <div class="form-group">
                                            <label class="col-lg-4 control-label">文件上传</label>
                                            <div class="col-lg-7">
                                                <input type="hidden" id="imageId" class="form-control"
                                                       th:value="${freeImage}"
                                                       placeholder="Input Box" readonly>
                                                <button class=" col-lg-1 btn btn-success pull-left" data-toggle="modal"
                                                        data-target="#addCate">选择
                                                </button>
                                            </div>

                                        </div>
                                        <hr/>

                                        <div class="form-group" id="cateConver">

                                            <div th:class="${conver.cateId}" th:each="conver, converStat:${albConver}">
                                                <label class="col-lg-1 control-label"
                                                       th:text="'【'+${conver.cateName} +'】封面'"></label>
                                                <div class="col-lg-1">
                                                    <img th:id="${conver.cateId}" th:name="${conver.imgId}"
                                                         th:src="${conver.coverUrl}" style="width: 60px;height: 80px;"
                                                         class="album_conver">
                                                </div>

                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <div class="col-lg-offset-1 col-lg-12">
                                                <div class="col-lg-7"></div>
                                                <button type="button" onclick="addAlbum()"
                                                        class=" btn btn-success">保存
                                                </button>

                                                <button type="button" class="btn btn-cancel"
                                                        onclick="cancell()">取消
                                                </button>
                                            </div>
                                        </div>

                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>


<div id="context-menu2">
    <input type="hidden" id="tempText">
    <ul class="dropdown-menu" id="role_menu" role="menu">
        <li th:id="'menu_'+${conver.cateId}" th:each="conver, converStat:${albConver}">
            <a tabindex="-1" th:text="'设为【'+${conver.cateName}+'】封面'"></a>
        </li>
    </ul>
</div>

<div class="modal fade" id="addCate" tabindex="-1" role="dialog"
     aria-labelledby="addCateLabel">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title" id="myModalLabel">
                    上传图片
                </h4>
            </div>
            <div class="modal-body ">
                <form class="form-horizontal" role="form" action="/view/uploadList" enctype="multipart/form-data"
                      method="post">
                    <div class="form-group">
                        <label class="col-lg-4 control-label">文件上传</label>
                        <div class="col-lg-8">
                            <input id="fileName" type="file" class="form-control pull-right" multiple>
                        </div>
                        <button type="button" class="btn btn-success" onclick="imagetUpload()">
                            上传
                        </button>
                    </div>
                    <div class="form-group">
                        <label class="col-lg-4 control-label">是否压缩</label>
                        <div class="col-lg-8">
                            <div class="col-lg-8" style="height: 28px">
                                <div class="make-switch" id="isZip" data-on="primary" data-off="info">
                                    <input type="checkbox" checked value="1" data-th-size="small">
                                </div>
                            </div>
                        </div>
                    </div>
                    <hr/>
                </form>
                <div class="gallery pre-scrollable" id="uploadImages" style="height: auto">
                    <div class="col-lg-2" th:each="image, imageStat:${imagesList}">
                        <img th:src="${image.originalUrl}" width="60px" th:name="${image.imgId}" height="80px"
                             class="prettyPhoto[pp_gal]">
                        <div class="checkbox"><input type="hidden" id="uploadImg" th:value="${image.imgId}">
                            <label><input th:id="${image.imgId}" type="checkbox"
                                          th:checked="${image.isFree}==0">免费</label>
                        </div>
                    </div>
                </div>
            </div>

            <div class="modal-footer">
                <button type="button" class="btn btn-primary" onclick="getFree()">
                    确定
                </button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>
<!-- Mainbar ends -->
<div class="clearfix"></div>

</div>
<!-- Content ends -->

<div th:include="/base/common_footer"></div>
<!-- Scroll to top -->
<span class="totop"><a href="#"><i class="icon-chevron-up"></i></a></span>
<!--js????-->
<div th:include="/base/common_js"></div>

</body>
</html>